/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package actioncombination.common.value;

/**
 *
 * @author Administrador
 */
public class IntegerValue extends Value<Integer> {

    private Integer value;
    private String string;

    public IntegerValue(int value) {
        this.value = value;
        string = String.valueOf(value);
    }

    public Integer getValue() {
        return value;
    }

    @Override
    public String toString() {
        return string;
    }

    @Override
    public boolean equals(Object object) {
        if (object instanceof IntegerValue) {
            return string.equals(object.toString());
        }
        return false;
    }

    @Override
    public int hashCode() {
        return string.hashCode();

    }

    public int compareTo(Integer o) {
        return this.value.compareTo(o);
    }
}
